!!!
%html
  %body
    .span15
      %br
      .container
        - if @user
          %h2 Edit User
        - else
          %h2 Add User
        %br
        .row
          .col-md-10
            - if @user
              %form{class: 'form-horizontal', action: '/accounts/save', method: 'post'}
                .form-group
                  %label.control-label.col-xs-2{for: ''} Username
                  .col-md-6
                    %input{type: 'textbox', class: 'form-control', name: 'username', id: 'username', value: @user.username}
                .form-group
                  %label.control-label.col-xs-2{for: ''} Reset Password
                  .col-md-6
                    %input{type: 'password', class: 'form-control', name: 'password', id: 'password'}
                .form-group
                  %label.control-label.col-xs-2{for: ''} Confirm Password
                  .col-md-6
                    %input{type: 'password', class: 'form-control', name: 'confirm', id: 'confirm'}
                .form-group
                  %label.control-label.col-xs-2{for: ''} Email Address (optional)
                  .col-md-6
                    %input{type: 'textbox', class: 'form-control', name: 'email', id: 'email', value: @user.email}
                .form-group
                  %label.control-label.col-xs-2{:for => ""} MFA (Google Authenticator)
                  .col-md-6
                    %input{:type => 'checkbox', :class => 'form-control', :name => 'mfa', :id => 'mfa', :checked => @user.mfa}
                - if @user.mfa
                  .form-group
                    %label.control-label.col-xs-2{:for => ""} QR Code
                    .col-md-6
                      %img{:src => @otp, :alt => "Google Authenticator QR Code" }
                      %link{:href => "#{@otp}", :rel => "stylesheet"}

                .form-group
                  .col-xs-offset-2.col-xs-10
                    %input{type: 'hidden', name: 'account_id', value: "#{params[:account_id].to_s}"}
                    %button.btn.btn-primary{type: 'submit'} Save
            - else
              %form{class: 'form-horizontal', action: '/accounts/create', method: 'post'}
                .form-group
                  %label.control-label.col-xs-2{for: ''} Username
                  .col-md-6
                    %input{type: 'textbox', class: 'form-control', name: 'username', id: 'username'}
                .form-group
                  %label.control-label.col-xs-2{for: ''} Password
                  .col-md-6
                    %input{type: 'password', class: 'form-control', name: 'password', id: 'password'}
                .form-group
                  %label.control-label.col-xs-2{for: ''} Confirm Password
                  .col-md-6
                    %input{type: 'password', class: 'form-control', name: 'confirm', id: 'confirm'}
                .form-group
                  %label.control-label.col-xs-2{for: ''} Email Address (optional)
                  .col-md-6
                    %input{type: 'textbox', class: 'form-control', name: 'email', id: 'email'}
                .form-group
                  %label.control-label.col-xs-2{:for => ""} MFA (Google Authenticator)
                  .col-md-6
                    %input{:type => 'checkbox', :class => 'form-control', :name => 'mfa', :id => 'mfa'}
                .form-group
                  .col-xs-offset-2.col-xs-10
                    %button.btn.btn-primary{type: 'submit'} Create
